package hxy.ecnu.service.impl;

import hxy.ecnu.dao.UserDao;
import hxy.ecnu.model.User;
import hxy.ecnu.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Slf4j
@Service
public class UserServiceImpl implements UserService {

//	@Resource
	@Autowired
	private UserDao userDao;

	@Override
	public ArrayList<User> findAll() {
		log.info("查询数据库");
		return userDao.findAll();
	}

	@Override
	public boolean insert(User user) {
		// TODO Auto-generated method stub
		return userDao.insert(user);
	}

	@Override
	public boolean delete(String id) {
		userDao.delete(id);
		return false;
	}

	@Override
	public int deleteUserById(String id) {
		
		return userDao.deleteUserById(id);
	}

}
